<!DOCTYPE HTML>
<html>
<head>
    <include file="Common:header_include"/>
    <title>添加科室</title>
</head>
<body>
<div class="pd-20">
    <form action="{:U('edit')}" method="post" class="form form-horizontal" id="form">
    <input name="id" value="{$data.id}" hidden="hidden">
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>医院：</label>
            <div class="formControls col-8">
                <span class="select-box">
                <select class="select Validform_error" size="1" name="hospital_id" id="hospital_id" datatype="*" nullmsg="请选择" onchange="getdafaultlist()">
                    <option value="" selected="" disabled="disabled">请选择</option>
					<option value="-1"  <if condition="$data['hospital_id'] eq -1">selected</if>>通用型化验单</option>
                    <volist name=":getLists(hospitalinfo)" id="v">
                        <option value="{$v['id']}" <if condition="$data['hospital_id'] eq $v['id']">selected</if>>{$v['name']}</option>
                    </volist>
                </select>
                </span>
            </div>
          
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>默认检查单:</label>
            <div class="formControls col-8">
                <span class="select-box">
		 
                <select class="select Validform_error" size="1" name="inspectioninfo_id" id="inspectioninfo_id" datatype="*" nullmsg="请选择">
                    <volist name=":getdefaultlist($data['hospital_id'])" id="v">
                          <option value="{$v['type']['id']}" <if condition="$v['type']['id'] eq $data['inspectioninfo_id']">selected</if>>{$v['type']['name']}</option>
                    </volist>
                </select>
                </span>
            </div>
           
        </div>
       <div class="row cl">
	    <label class="form-label col-3"><span class="c-red"></span>排序:</label>
            <div class="formControls col-8">
                <input type="text" class="input-text"   name="sort" value="{$data['sort']}">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red"></span>描述：</label>
            <div class="formControls col-8">
                <textarea rows="5" cols="34" style="resize:none" class="textarea" name="description" placeholder="请输入描述信息">{$data['description']}</textarea>
            </div>
        </div>
        <div class="row cl">
            <div class="col-7 col-offset-5">
                <input class="btn btn-primary radius" type="submit" value="提交">
            </div>
        </div>

    </form>
</div>
<include file="Common:footer_include"/>
<script>
    //getdafaultlist();
   // function getdafaultlist(){
      // var hospital_id=$("#hospital_id option:selected").val();
//if(hospital_id==""){
      //      hospital_id={$data['hospital_id']};
//}
//var inspectioninfo_id = $('#inspectioninfo_id');
      //  var ajaxurl='{:U("DefaultInspectioninfo/getdefaultlist")}?hospital_id=' + hospital_id;
//inspectioninfo_id.html('');
       // $.ajax({
         //   url:ajaxurl ,
          //  type: 'post',
          //  enctype: 'multipart/form-data',
           // success: function (data) {
            //    $.each(data, function (i, items) {
//inspectioninfo_id.append('<option  value="'+ items.id + '" >'+ items.name + '</option>');
           //     });
           // }
       // });
  //  }
</script>
</body>
</html>